package com.zhaokuner.springcloudconfigclientone.controller;

import com.zhaokuner.springboot.zk.ZkRefreshLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.endpoint.RefreshEndpoint;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * Description:模拟刷新
 * <p>
 * Copyright: 2018-现在 北京掌通未来科技有限公司
 * <p>
 *
 * @author 赵希坤 zhaoxikun
 * @date 2020/7/24 14:26
 */
@RestController
public class RefreshCtrl {

    @Autowired
    private RefreshEndpoint refreshEndpoint;
    @Autowired(required = false)
    private ZkRefreshLog zkRefreshLog;

    @RequestMapping("/myRefresh")
    public Object refresh() {
        return refreshEndpoint.refresh();
    }

    @RequestMapping("/log")
    public Object zkRefreshLog() throws Exception {
        return zkRefreshLog.map();
    }
}
